FROM php:7.2.34-fpm

#apt-get的加速镜像
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list

#更新apt-get
RUN apt-get update

#安装pdo_mysql
RUN docker-php-ext-install pdo_mysql

#安装gd库
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd

#安装bcmath
RUN docker-php-ext-install bcmath

#复制pecl模块
COPY ./file/* /usr/local/src/

#安装xdebug
RUN pecl install /usr/local/src/xdebug-3.0.4.tgz \
    && docker-php-ext-enable xdebug

#复制php配置文件
RUN mv $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini

#复制自定义的xdebug和其他的配置文件
COPY ./conf.d/* /usr/local/etc/php/conf.d/
